Julian Sparber [Mon, 12 Feb 2024 09:16:36 +0000 (10:16 +0100)]
messageTray: Drop createBanner()
This removes the `createBanner()` method on `Notification` and `Source`.
Since we want to use the same widget for the calendar and the banner,
let's not allow to create custom widgets just for the banner.
Julian Sparber [Wed, 21 Feb 2024 11:07:10 +0000 (12:07 +0100)]
notifications: Add buttons to Calendar.NotificationMessage via actions
Since we also want to show the buttons in the calendar move the
code to add buttons/actions from `MessageTray.NotificationBanner` to
`Calendar.NotificationMessage`.
As nothing uses custom buttons that aren't backed by actions anymore,
remove that bit of the public API.
Julian Sparber [Fri, 9 Feb 2024 11:55:44 +0000 (12:55 +0100)]
components/autorunManager: Use notification actions API
Stop using custom buttons for notification actions. The only reason to
use custom buttons was so that we could add icons next to the button
label, if we really need the icons next to the label we can add icons to
the notification API.
By using the actions API we can ensure that buttons always look the
same without additional work.
Julian Sparber [Wed, 14 Feb 2024 17:55:08 +0000 (18:55 +0100)]
FdoNotificationDaemon: Actually associate a Source with an app
Actually link a notification source with an app instead of just to
its app name and PID, which in many cases don't really identify an
app. E.g. for portal applications the PID points to the
xdg-desktop-portal.
Use the app when ever possible but keep using the app name and PID
as a fallback.
Julian Sparber [Tue, 13 Feb 2024 18:25:57 +0000 (19:25 +0100)]
messageTray: Add object holding sound for a notification
A notification can have two ways to specify a sound, via a name of a
sound in the sound theme and/or a file. Therefore introduce an object
that can hold both properties and creates an abstraction over the
different source. This reduces the number of properties for a
notification, which will make it simpler to port it to GObject
properties.
Julian Sparber [Fri, 9 Feb 2024 19:08:25 +0000 (20:08 +0100)]
components: Drop telepathy client
The telepathy client component has been unmaintained for a long time.
Now that we rework the notifications massively it's time to drop the
support for it.
Florian Müllner [Tue, 20 Feb 2024 12:12:43 +0000 (13:12 +0100)]
userWidget: Stop expand flags from propagating
Since commit 9c2da01a9, the avatar's child is expanded to account
for the new St.Bin behavior. However as expand flags are propagated
up, this now results in avatar actor getting unintentionally expanded
in places like the end-session dialog.
Stop this by explicitly setting the avatar actor to not expand.
Jonas Dreßler [Fri, 1 Mar 2024 16:24:37 +0000 (17:24 +0100)]
status/network: Sync active connections again on connection-added
NetworkManagers NmClient has a bug for wireguard connections where the
notify::active-connections and connection-added are emitted in the wrong order:
When a wireguard connection gets activated, notify::active-connections is
emitted first, then connection-added happens.
We currently expect these signals to emitted in the correct order, so our VPN
toggle is not actually updated when a wireguard connection is established.
Until this bug is fixed in NetworkManager, work it around by calling
_syncActiveConnections() manually after we see ::connection-added.
Some extensions try to destroy the provided dialog, so they can
instead show the preferences in an alternative way.
Unfortunately that is undetectable from the Extensions service,
which still thinks the dialog is open, and will therefore block
other prefs dialogs.
Try to steer extensions away from that anti-pattern (or at the
very least switch to `close()` which doesn't break) by overriding
the window's destroy() method and show an extension error instead.
Jonas Dreßler [Sun, 22 Jan 2023 18:29:23 +0000 (19:29 +0100)]
screencastService: Add gstreamer pipeline for h264 encoding
Add pipelinea for h264 software encoding using openh264. This is the least
problematic (from a patent perspective) software encoder for h264, Fedora
ships it in a pre-installed repo and it can be enabled very easily. Most
people should have it enabled already to allow for decoding of h264 content.
Unlike vp8enc, this encoder is optimized for realtime and is really fast, it
outperforms the vp8 encoder by an order of magnitude and should allow for
smooth recordings even on older hardware.
The reason why mp4 was chosen as a container format over mkv is that mp4
can be played inside firefox and chromium, whereas mkv can't be played.
It's ensured that the mp4 file is still playable in case the recording
got cancelled by using the "first-moov-then-finalise" fragment-mode on
mp4mux.
Even though h264 is problematic from a patent perspective and often can't
be shipped by default, it still the best supported and most popular codec
out there. The software encoders and decoders are really fast, it's used
everywhere on the web, and it can be hardware decoded on almost any device
out there.
See also: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2080
Jonas Dreßler [Sun, 22 Jan 2023 18:43:53 +0000 (19:43 +0100)]
screencastService: Allow for file extensions depending on encoder used
Depending on the encoder we want to use a different container format and
therefore a different file extension. Right now this file extension is
forced to be webm, so shuffle things around a bit to make that more
dynamic.
Note that this also introduces removing for the old file created by the
recorder, otherwise it would create an empty "mp4" file every time it
falls back from "mp4" to "webm".
To be nice to external (ie. not gnome-shell) consumers of the
screencastService, let's not break the API completely, and detect the
".webm" suffix a little longer to not end up with weird file.webm.webm
filenames.
Joan Torres [Mon, 12 Feb 2024 17:10:25 +0000 (18:10 +0100)]
loginDialog: Close conflicting session dialog after 60 secs
When the stop conflicting session dialog is opened, use a timeout of 60
seconds to close it.
This is an attempt to keep security in the situation where the user leaves,
the system is left unsupervised and the dialog is opened; allowing anyone
to stop the old session and start a new session.
When the dialog is closed by the timeout, a notification apperars informing
about that.
Joan Torres [Wed, 7 Feb 2024 12:05:17 +0000 (13:05 +0100)]
loginDialog: On login, allow logout a conflicting session
When opening a session, find if there's already a session opened for the
same user with the help of Loginmanager.
When it's found, display the conflicting session dialog.
The logout dialog allows shutting down the conflicting session using the
greeter dbus method "StopConflictingSession".
If the dialog is already opened and the conflicting session has been
closed on its side, the new session will start.
Florian Müllner [Thu, 29 Feb 2024 15:28:25 +0000 (16:28 +0100)]
doap: Replace outdated wiki references
Use the gitlab project page as homepage, and point to the in-tree
build documentation instead of referencing a script that has been
outdated for years.
Carlos Garnacho [Tue, 30 Jan 2024 12:53:03 +0000 (13:53 +0100)]
keyboard: Forward/handle content hints
Forward these from the IM, and handle the ones involving
the OSK state: lowercase/uppercase/auto_capitalization/titlecase.
The latter two involve peeking at the surrounding text, to figure
out if it makes sense to toggle keyboard level.
Carlos Garnacho [Tue, 30 Jan 2024 10:24:56 +0000 (11:24 +0100)]
ibusManager: Avoid changes to ibus-typing-booster configuration
The ibus-typing-booster IM module is already meant to do the "right"
thing when the IBus.Capabilite.OSK hint is passed to the IM. We do
already honor that hint (commit 23bfd08b3c9), and ibus-typing-booster
has been doing this for a reasonably long time (first release seems
to be 2.19.9 dated 2 years ago, current is 2.24.12).
Drop this mangling of foreign settings, and let ibus-typing-booster
figure out the optimal configuration given the presence of an OSK.
Carlos Garnacho [Tue, 30 Jan 2024 10:08:52 +0000 (11:08 +0100)]
keyboard: Refactor 'commit' action handling
Move the complex parts of this mechanism from the Keyboard object
to the KeyboardController object, replaced by code that is easier to
follow.
Also, keyval guessing is deferred to a later point in the commit
procedure so so it does not happen for a single character only,
this way we can send multi-character input through the IM, which
is necessary for some OSK layouts.
Carlos Garnacho [Mon, 29 Jan 2024 14:44:38 +0000 (15:44 +0100)]
keyboard: Support OSK layout modes explicitly
We only support "latched" which stays toggled on for a single
character unless long-pressed. Support "default" mode explicitly
to switch back to the default level, leaving "locked" implicitly
supported as the way to stay in the same level.
Carlos Garnacho [Sat, 27 Jan 2024 13:26:05 +0000 (14:26 +0100)]
keyboard: Close keyboard immediately on Clutter.InputPanelState.OFF
This is already covered by a timeout to handle focus transitions between
windows at the Clutter.InputMethod implementation, we can react immediately
and avoid chaining up timeouts.
Carlos Garnacho [Fri, 26 Jan 2024 19:25:02 +0000 (20:25 +0100)]
keyboard: Drop dead code
This getGroups() method was not called anywhere for
a long time, the last user was dropped at commit 8fdf47ea5b ("keyboard: Do not create widgetry for
all keyboard groups at once").
Carlos Garnacho [Fri, 26 Jan 2024 19:22:14 +0000 (20:22 +0100)]
keyboard: Simplify group change emission at KeyboardController
Since we now just store the current group, we do not need to track
closely source changes vs selection changes in the available sources.
We just re-generate the current OSK keymap for all, so coalesce both
signals into a more generic "group-changed".
Carlos Garnacho [Fri, 26 Jan 2024 18:54:39 +0000 (19:54 +0100)]
keyboard: Honor emoji-visible through input hints
And fix it so it is effective again. This is a small piece of
smarts the code needs to earn, so that keys with the "emoji"
action are hidden, and their width assigned to the next key.
Carlos Garnacho [Fri, 26 Jan 2024 18:12:11 +0000 (19:12 +0100)]
keyboard: Refer to levels by name instead of index
And drop some more guesswork in the code, since some layouts have
less than 4 levels. This also allows for having OSK maps with more
than 4 levels. Let us hope that the sanity of our future kin will
remain below that threshold.
Carlos Garnacho [Fri, 26 Jan 2024 17:04:18 +0000 (18:04 +0100)]
keyboard: Replace Keypad object with a "digits" JSON OSK keymap
Drop some code, in favor of a numeric keypad that is driven through
the same JSON-based maps. This is also a first use of the "height"
key property in the JSON files, for the Enter key.
Carlos Garnacho [Fri, 26 Jan 2024 16:42:52 +0000 (17:42 +0100)]
keyboard: Allow for terminal variants in specific languages
Do not hardcode the us-terminal OSK keymap, and append '-extended'
to the current group name, accounting with the existing 'us' fallback.
This allows for concerned individuals to propose language-specific
terminal layouts.
Carlos Garnacho [Fri, 26 Jan 2024 15:32:19 +0000 (16:32 +0100)]
keyboard: Handle extended keyboards through TERMINAL input purpose
Drop the channeling of this specific signal from the InputMethod, and
update the OSK Keyboard object to using the purpose hint to find out
whether a extended keymap is necessary.
Carlos Garnacho [Fri, 26 Jan 2024 15:20:30 +0000 (16:20 +0100)]
keyboard: Forward input purpose from KeyboardController
Instead of adding more emoji/keypad signals, forward the input
purpose, so that in future commits the Keyboard object can figure
out the right layout from the purpose hint.
Carlos Garnacho [Fri, 26 Jan 2024 13:25:57 +0000 (14:25 +0100)]
keyboard: Add/document "height" optional property
This will allow OSK descriptions to declare "tall" keys. May be
used in combination with the "start" property added in previous
commits, in case a gap needs to be explicitly left.
Carlos Garnacho [Fri, 26 Jan 2024 12:07:00 +0000 (13:07 +0100)]
keyboard: Add/document "leftOffset" optional property on OSK keys
This optional property defines the offset the a key should have
relative to the previous key (on its left) or the start of the
column if it is the first key. If this property is not
present, the key will be placed with no relative offset.
This for example allows keymaps to explicitly define the padding
of the rows that are not "full" relative to other rows, without
guesswork in the code. It is used for this purpose in the
keymaps/levels/rows that needed it.
Carlos Garnacho [Fri, 26 Jan 2024 11:02:30 +0000 (12:02 +0100)]
keyboard: Simplify key width handling
We do not need to store the key width in the Key object
itself when constructing the layout, and can attach it
to the grid from the model data right away.
Sebastian Keller [Fri, 21 Apr 2023 22:05:22 +0000 (00:05 +0200)]
keyboard: Delete selected text on backspace
Previously backspace would only ever remove a single character left of
the cursor, regardless of selection.
This requires the application to correctly set the anchor position in
text_input::set_surrounding_text(), which currently only gtk4 seems to
do. When there is no selection or on other applications that always set
cursor = anchor, like gtk3 does, the behavior is not changed and still
only deletes one character.
Sebastian Keller [Wed, 21 Feb 2024 14:20:24 +0000 (15:20 +0100)]
keyboard: Fix deleting the previous word
Since mutter@33088d59 the cursor we receive from mutter already is a
character index while the code here still treated it like a byte offset.
Further the code to detect the previous word position was treating the
cursor parameter already like a character index, while passing the
cursor that was prior to that commit a byte offset.
The function also had some unreachable and redundant code paths. The
pos < 0 case can never be reached due to the max(). Also the regex
already ensures that all whitespace is considered, so the code to remove
spaces not actually do anything except when deleting the first word in
the text, in which it would cause the first character to not get
deleted.
Also it was not handling characters with more than 2 bytes correctly. In
the presence of these JS string functions, such as search(), can not be
considered to operate on character indices anymore but rather the number
of UTF-16 byte pairs. Issues with this can be avoided by using
iterators, which unlike anything else iterate on characters, not byte
pairs and by not using the results returned by JS string functions for
anything but JS strings.
Given that this may lead to the shell to hang on gdm startup, and that
we expect the service to be up and running quickly, we can safely set a
5 seconds timeout instead of using the longer GLib proxy defaults.
gdm/util: Use fully async call to setup the fingerprint device proxy
Since fingerprint service can now be started also if a conversation has
already began, we can also initialize the proxy asynchronously, without
the risk that the service won't be started early enough.
As per this, remove the usage of FprintDeviceProxy wrapper completely
since it's just not giving us anything here.
gdm/util: Only start fingerprint service synchronously when it's default
On ShellUserVerifier construction we used to start fprintd in a sync
fashion all the times, however in case the daemon had startup failures
or was hanging for whatever reason (like due to devices probing, given
that fprintd synchronously wait for them all to be initialized) we used
to just fail, leaving gdm or the lockscreen in a not usable state.
While this could be prevented with a try/catch statement, there's no
much point to wait for fprintd if that's not the default authentication
service, and so:
- If we use gdm-fingerprint as default auth method, use a sync call to
initialize it and in case of failures, just continue with fallback
authentication mechanism (password)
- Otherwise, asynchronously initialize fprintd and continue with the
ShellUserVerifier without fingerprint support until we got a reply.
In case the service fails to deliver us a result, we don't give up
but we will try doing that at each authentication via
_checkForFingerprintReader().
In case all works properly, as per the previous commit, once the
initialization is done, we'll start the fingerprint PAM gdm service.
gdm/util: Only initialize fingerprint and smart card managers if needed
There's no point to initialize the fprint proxy and the smartcard
manager if they are disabled in authentication settings, so just avoid
initializing them, but at the same time this implies tracking of user
changes and so:
- If a new service has been enabled, we initialize it
- If a service has been disabled we destroy it and reset the
authentication if such service was currently active
gdm/util: Keep track of started services that are currently active
If we have a late activation of a service backend we may need to check
whether it has been already started, and in case it has not, we can try
loading it.
So rely on gdm to see what service has been started, instead of handling
it manually on our side only.
Daniel van Vugt [Fri, 23 Feb 2024 07:29:56 +0000 (15:29 +0800)]
theme: Don't give login-dialog another background-color
Its parent `lockDialogGroup` has exactly the same background-color
set in the same file. Giving them both the same wasted render time on
overdraw, and caused multi-layer blending artifacts (slight flickering
of the grey background) when the login dialog fades in/out.
While the flicker can also be fixed using `set_offscreen_redirect`,
there's no point adding that overhead when the extra layer doesn't need
to be painted. Removing it halves the average render time of the login
animation.
Julian Sparber [Mon, 19 Feb 2024 14:15:48 +0000 (15:15 +0100)]
shell/global: Don't force active workspace for launch context
Since the launch context may also be used to activate an action on an
running application with an already existing window, which we don't
necessarily want to move to a different workspace, don't set a workspace
for the launch context. If no active window exists for an application
then it will be place on the currently active workspace anyways.
Julian Sparber [Mon, 19 Feb 2024 08:30:25 +0000 (09:30 +0100)]
shell/app: Add method to activate an action via FDO DBus activation
There are multiple different places where we activate an app action,
but none set the correct activation token. Therefore this adds an async
method to to call `ActivateAction` on `org.freedesktop.Appliaction`
with the correct activation token/startup id as platform data.
Florian Müllner [Fri, 23 Feb 2024 23:00:34 +0000 (00:00 +0100)]
ci: Don't install entire Development group
With dependencies, the group pulls in about 150 packages. We only
need a tiny tiny subset of that, so only specify what we really
need to not blow up the image size unnecessarily.